package pers.vicxu.mvcrestplus.pojo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Create by Vic Xu on 7/25/2018
 *
 * @author Vic Xu
 */
@Entity
@Table(name = "books")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public class Book implements Serializable {
    private static final long serialVersionUID = -8345456667402710848L;

    @Id
    @GenericGenerator(name = "customerUUID", strategy = "uuid")
    @GeneratedValue(generator = "customerUUID")
    private String id;

    @Column
    private String bName;
    @Column
    private double price;
    @Temporal(TemporalType.TIMESTAMP)
    private Date pressDate;
    @Column
    private String author;

    public Book() {
    }

    public Book(String bName, double price, Date pressDate, String author) {
        this.bName = bName;
        this.price = price;
        this.pressDate = pressDate;
        this.author = author;
    }

    public Book(String id, String bName, double price, Date pressDate, String author) {
        this.id = id;
        this.bName = bName;
        this.price = price;
        this.pressDate = pressDate;
        this.author = author;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getbName() {
        return bName;
    }

    public void setbName(String bName) {
        this.bName = bName;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getPressDate() {
        return pressDate;
    }

    public void setPressDate(Date pressDate) {
        this.pressDate = pressDate;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }
}
